package com.fyt.ZhongYaoApp.mapper;

import com.fyt.ZhongYaoApp.pojo.DoctorCat;
import com.fyt.ZhongYaoApp.pojo.DoctorCatDet;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DoctorCatMapper {

    // 新增
    @Insert("insert into doctor_cat(dc_name) " +
            "values(#{dcName})")
    void add(DoctorCat doctorCat);

    @Select("select dc_name from doctor_cat where id = #{id}")
    String getDoctorCat(DoctorCat doctorCat);

    @Select("select id,name from doctor_cat_det where cat_id = #{id}")
    List<DoctorCatDet> getDoctorCatDetByCatId(DoctorCat doctorCat);
}
